< previous page page_579 next page >

Page 579
0579-01.jpg
Figure 16.13
Gouraud shading of a sphere containing 100 polygons.
Example program GZOrder, shown in Figure 16.15, uses Gouraud shading to draw several kinds of surfaces. The most interesting difference between this program and program Gouraud is in how it calculates vertex normals.
Program Gouraud uses the fact that the normal of the point (x, y, z) on the surface of a sphere of radius R centered at the origin is <x/R, y /R, z/R>. That does not work for more
0579-02.jpg
Figure 16.14
Gouraud shading of a sphere containing 10,000 polygons.

 
< previous page page_579 next page >